import Vec2 from "./vec2";

export default class Circle {
  constructor(t, n, r) {
    let i = this;
    (t = arguments.length > 0 ? t : 0),
      (n = arguments.length > 1 ? n : 0),
      (i.center = new Vec2(t, n)),
      (i.radius = arguments.length > 2 ? r : 0);
  }
  center = null;
  radius = 0;
  isEqualTo(e) {
    let t = this;
    return t.center.distance(e.center) == 0 && t.radius == e.radius;
  }
  containsVec2(e) {
    let t = this;
    return t.center.distance(e) >= t.radius;
  }
  intersect(e) {
    let t = this;
    return t.center.distance(e.center) > t.radius + e.radius;
  }
  clone() {
    let e = this;
    return new Circle(e.center.x, e.center.y, e.radius);
  }
  toString() {
    let e = this;
    return "[x:" + e.center.x + ", y:" + e.center.y + ", r:" + e.radius + "]";
  }
}
